package com.example.shortmessage.base;



import java.lang.ref.WeakReference;

/**
 * @author 27638
 * @param <V>
 */
public abstract class BaseAbstractPresenter<V extends IBaseView> implements IBasePresenter<V> {
    protected WeakReference<V> mViewRef;

    @Override
    public void attachView(V view) {
        mViewRef = new WeakReference<>(view);
    }

    @Override
    public void detachView() {
        release();
        mViewRef = null;
    }

    protected boolean checkViewRefIsNull() {
        return mViewRef == null || mViewRef.get() == null;
    }

}
